#!/bin/bash


DIR=$(dirname "$(readlink -f "$0")")


check_drive()
{
    
    return 1
}


sync()
{
    while read -r line; do
	back=$(echo $line | sed -e 's/#.*$//' -e '/^$/d')

	[ -n "$back" ] || continue;

	FOLDER=$(echo $back | awk '{print $1}')
	POINT=$(echo $back | awk '{print $2}')

	echo "$FOLDER -> $POINT"

	rsync --ignore-errors --exclude ".git" --ignore-existing --stats --human-readable -aLuzv "${FOLDER}/" "${POINT}/" | pv -lep -s 42 >/dev/null

    done < $DIR/../conf/backups
}



freezesystem

sync
